﻿

/*
这个类是 T4 模板引擎自动生成的.
不要手工添加，修改，
添加要改请修改同目录下是ErrorCode.xml文件
*/

using System;
using System.Runtime.Serialization;
using FeCMS.Common.Enum;
using FeCMS.Common.Interface;
namespace  FeCMS.Common
{

    ///<summary>
	/// 错误代码类
	///</summary>
	public class ErrorCode:IErrorCode
	{

		///<summary>
		///		构造方法
		///</summary>
		///<param name="code">错误代码</param>
		public ErrorCode(string code ) : this( code, string.Empty, string.Empty, ErrorLevel.Other)
		{
		
		}
		
		///<summary>
		///		构造方法
		///</summary>
		///<param name="code">错误代码</param>
		///<param name="shortMessage">错误短信息</param>
		public ErrorCode(string code, string shortMessage) : this(code, shortMessage, string.Empty, ErrorLevel.Other)
		{
		
		}
		 
		
		///<summary>
		///		构造方法
		///</summary>
		///<param name="code">错误代码</param>
		///<param name="shortMessage">错误短信息</param>
		///<param name="longMessage">错误长信息</param>
		///<param name="errorLevel">错误等级</param>
		public ErrorCode(string code, string shortMessage, string longMessage,ErrorLevel errorLevel)
		{			
			this.Code = code;
			this.ShortMessage = shortMessage;
			this.LongMessage = longMessage;
			this.ErrorLevel = errorLevel;
			
			long tmpCode = Convert.ToInt64(code, 16);			
			this.ErrorValue = unchecked((int)tmpCode);
		}
		
		///<summary>
		///		十六进制错误代码
		///</summary>
		public string Code
		{
			get;
			set;
		}
		
		///<summary>
		///		错误的短消息
		///</summary>
		public string ShortMessage
		{
			get;
			set;
		}
		
		///<summary>
		///		错误的长消息
		///</summary>
		public string LongMessage
		{
			get;
			set;
		}
		
		///<summary>
		/// 错误代码的int值
		///</summary>
		public int ErrorValue
		{
			get;
			set;
		}
	

		///<summary>
		/// 错误代码的int值
		///</summary>
		public ErrorLevel ErrorLevel
		{
			get;
			set;
		}

		        ///<summary>
		///添加失败错误信息模板。【0：添加的内容】
		///</summary>
		public static ErrorCode ErrorCodeTemplate_Add 
		{
			get
			{ 
				return new ErrorCode("0x00010000", "添加失败", "添加{0}失败。",ErrorLevel.Site); 
			}
		}
			
		        ///<summary>
		///删除失败错误信息模板。【0：删除的内容】
		///</summary>
		public static ErrorCode ErrorCodeTemplate_Del 
		{
			get
			{ 
				return new ErrorCode("0x00010100", "删除失败", "删除{0}失败。",ErrorLevel.Site); 
			}
		}
			
		        ///<summary>
		///修改失败错误信息模板。【0：修改的内容】
		///</summary>
		public static ErrorCode ErrorCodeTemplate_Edit 
		{
			get
			{ 
				return new ErrorCode("0x00010200", "修改失败", "修改{0}失败。",ErrorLevel.Site); 
			}
		}
			
		        ///<summary>
		///查找失败错误信息模板。【0：查询的内容】
		///</summary>
		public static ErrorCode ErrorCodeTemplate_Search 
		{
			get
			{ 
				return new ErrorCode("0x00010300", "查找失败", "查找{0}失败。",ErrorLevel.Site); 
			}
		}
			
		        ///<summary>
		///不存在。【0：对象】
		///</summary>
		public static ErrorCode ErrorCodeReason_DoesNotExist 
		{
			get
			{ 
				return new ErrorCode("0x00010000", "不存在", "{0}不存在。",ErrorLevel.Site); 
			}
		}
			
		        ///<summary>
		///找不到。【0：查询的内容】
		///</summary>
		public static ErrorCode ErrorCodeReason_DoesNotFound 
		{
			get
			{ 
				return new ErrorCode("0x00010001", "找不到", "找不到{0}。",ErrorLevel.Site); 
			}
		}
			
		        ///<summary>
		///找不到。【0：对象名称】
		///</summary>
		public static ErrorCode ErrorCodeReason_IsNull 
		{
			get
			{ 
				return new ErrorCode("0x00010002", "对象为空", "对象为{0}空。",ErrorLevel.Site); 
			}
		}
			
		        ///<summary>
		///对象转换出错
		///</summary>
		public static ErrorCode ObjectConversionError 
		{
			get
			{ 
				return new ErrorCode("0x00020000", "对象转换出错", "",ErrorLevel.System); 
			}
		}
			
			}
}